import request from '@/utils/request'

export interface CategoryValueModel{
  categoryId:string |number,
  categoryName:string
}
export type CategoryModel={
  category:CategoryValueModel[]

}
export type AnyObject = {
  [propsName: string]: any
} 
export type QueryObject = {
  id: string | number,
  [propsName: string]: any
}
export interface DetailModel{
  kw:string,
  core:string,
  page:number,
  rows:number,
  condition?:string
  paidFilter?:boolean,
  is_paid?:boolean | string,
  category_id?:number|string
 fq?:any


}
export default {
  reqCategoryList(){
    return request.get<any,CategoryModel>(`/hotWordBillboardCategory`)
  },
  reqHotWordList(categoryId:number,size:number){
    return request.get<any,AnyObject>(`/hotWordBillboard/list/2.0?categoryId=${categoryId}&size=${size}`)
  },
  //实时关键字列表
  reqKeyWordList(kw:string,paidFilter:string){
    return request.get<any,AnyObject>(`/revision/suggest?kw=${kw}&paidFilter=${paidFilter}&scope=all`)
  },
  //搜索详情
  reqSearchDetail(data:DetailModel){
    return request.get<any,AnyObject>(`/m-revision/page/search?kw=${data.kw}&core=${data.core}&page=${data.page}&rows=${data.rows}&condition=${data.condition}`)
  },
  //专辑专用
  reqAll(kw:string){
    return request.get<any,AnyObject>(`/m-revision/page/search/allCategory?kw=${kw}`)

  }
}